From faaf616549058f4709e4fac34e1140c664c96fff Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 9 Jul 2014 12:11:32 -0700 Subject: [PATCH] Made getMaxLag() skip checking the master DB Change-Id: I81a9102570bf9a45af56f31d04e3a0f2be72b919 --- includes/db/LoadBalancer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index b3f9210120..0c4188ceda 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -1050,6 +1050,9 @@ class LoadBalancer { $maxIndex = 0; if ( $this->getServerCount() > 1 ) { // no replication = no lag foreach ( $this->mServers as $i => $conn ) { + if ( $i == $this->getWriterIndex() ) { + continue; // nothing to check + } $conn = false; if ( $wiki === false ) { $conn = $this->getAnyOpenConnection( $i ); -- 2.20.1